1. Field of the Invention
The present invention relates generally to cryptographic systems, and in particular, to a method, apparatus, and article of manufacture for the rapid generation of large prime numbers for use in a cryptographic system.
2. Description of the Related Art
Computer use has proliferated and continues to expand as technological capabilities rapidly increase. With this proliferation, computers often communicate and exchange information across a network. However, computer hackers and other persons often attempt to gain unauthorized access to such communications and information. To prevent unauthorized access, the messages and information may be encrypted. Encryption methods vary from using an external device known as a hardware key (or “dongle”) to using secret key encryption such as DES (Data Encryption Standard) or public key encryption (such as RSA). Many such encryption methods utilize and need prime numbers. However, because of the mathematical algorithms required to generate large prime numbers and the limited resources available in a typical cryptographic hardware token, the time required to generate a pair of keys (utilizing large prime numbers) is often on the order of several minutes. Accordingly, what is needed is a method for rapidly generating large prime numbers on a token. The problems and disadvantages of the prior art may be better understood by describing prior art encryption and the generation of keys.
As described above, one solution to prevent unauthorized access uses an external device known as a hardware key, or “dongle”. A dongle is coupled to an input/output (I/O) port of the host computer. An application executing on the host computer sends a code to that I/O port, and the dongle responds by reading out its serial number, which verifies its presence to the program. The dongle hinders software duplication, because each copy of the program is tied to a unique number, which is difficult to obtain, and the key has to be programmed with that number.
While the use of such hardware keys is an effective way to reduce software piracy, to date, their use has been substantially limited to high value software products. Hardware keys have not been widely applied to popular software packages, in part, because the hardware keys are too expensive, and in part, because there is reluctance on the part of the application program user to bother with a hardware key whenever use of the protected program is desired. Also, in many cases, the hardware keys are designed for use with only one application. Hence, where the use of multiple applications on the same computer is desired, multiple hardware keys must be operated at the same time.
In addition to dongles, other methods that utilize software encryption have been widely utilized. Simple encryption is the most common method of securing data. Both secret key encryption (e.g., DES (Data Encryption Standard)) and public, key encryption (e.g., RSA encryption) methods that use both a public and a private key are implemented. Public and private key encryption methods allow users to send Internet and e-mail messages without concern that the message will be read by unauthorized persons or that its contents will be tampered with.
Secret key encryption such as DES operates as a block cipher. Data is encrypted in 64-bit blocks. A 64-bit block of plaintext goes in one end of the algorithm, and a 64-bit block of ciphertext comes out the other end. The same algorithm and key are used for both encryption and decryption (except for minor differences in the key schedule). The key can be any 56-bit number (the remaining bits are utilized for parity checking), and may be changed at any time. To encrypt data using DES, a block of data is encrypted using a substitution followed by a permutation based on the key.
Various public-key encryption methods have been adopted and used in the prior art. One such method is RSA (Rivest-Shamir-Adleman) encryption. With RSA encryption, data is encrypted using a recipient's public key, which can only be decrypted by the recipient's private key. The security that exists in RSA encryption is based on the difficulty of factoring large numbers. The public and private keys are based on a pair of large prime numbers. Accordingly, to utilize RSA, two large prime numbers must be obtained. Details regarding RSA encryption are described in Bruce Schneier, “Applied Cryptography, Second Edition, Protocols, Algorithms, and Source Code in C”, pages 466–474 John Wiley & Sons, Inc. 1996), which is incorporated by reference herein.
Various methods have been developed to obtain a number and determine if the number is prime. Some such methods determine if a number is prime by trying to determine the factors of the number. Accordingly, some methods may generate random numbers and attempt to factor those numbers. Such a method may not be frequently used. Alternatively, in a more frequently used method, random numbers are generated and tested to determine if they are prime. However, testing if a number is prime may fail frequently, forcing the selection and testing of a random number repeatedly. In this regard, it often takes on the order of several minutes to generate an RSA key pair.
For example, one method for generating a prime number checks to make sure a random number is not divisible by a set of small prime numbers (e.g., 3, 5, 7, 11, etc.). Thus, some methods may test the random number for divisibility by all primes less than a certain number (e.g., 256 or 2000). Further, some methods may not generate random numbers but may incrementally search through numbers starting at a random point until a prime is found. Such prior art methods of generating prime numbers are described in Bruce Schneier, “Applied Cryptography, Second Edition, Protocols, Algorithms, and Source Code in C”, pages 233–263 John Wiley & Sons, Inc. 1996), which is incorporated by reference herein.
In view of the above, there are various methods for encrypting information and determining prime numbers to be utilized in the encryption. However, the prior art methodologies are slow and inefficient. Accordingly, what is needed is a method for rapidly generating large prime numbers for use in a cryptographic system.